package com.qf.controller;

import com.qf.pojo.repVo.BaseResp;
import com.qf.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
    PayService payService;

    /**
     * 支付
     * @param map
     * @return
     */
    @RequestMapping("/alipay")
    public BaseResp alipay(@RequestBody Map map){
        return payService.pay(map);
    }

    //支付宝的异步回调
    @RequestMapping("/notifyResult")
    public void notifyResult(HttpServletRequest request){
         payService.notifyResult(request);
    }
}
